import {Component, ElementRef, ViewChild} from '@angular/core';
import {AlertController, IonicPage, NavController, NavParams} from 'ionic-angular';
import {ContractService} from "../../service/contract.service";
import {ContractApiService, ContractDetail} from "../../api/contract-api.service";
import {ImageApiService} from "../../api/image-api.service";
import construct = Reflect.construct;
import {EventService} from "../../service/event.service";
import {LocalStorage} from "../../utils/localstorage.utils";
import {ROUTER} from "../../service/router.service";

@IonicPage()
@Component({
  selector: 'page-contract',
  templateUrl: 'contract.html',
})
export class ContractPage {
  contractId:number;
  contractDetail:ContractDetail;
  constructor(public navCtrl:NavController,
              public navParams:NavParams,
              private contractService:ContractService,
              private eventService:EventService,
              protected alertCtrl:AlertController,
              private contractApiService:ContractApiService,
              private ls:LocalStorage,
              private imageApiService:ImageApiService,
              private ROUTER: ROUTER
  ) {
    this.contractId = this.ls.getObject('contractId');
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad ContractPage');
    this.contractApiService.getDetail(this.contractId, v => {
      this.contractDetail = v
    })
  }

}
